from flask import Blueprint
from .view.user import user as user_bp
from .view.goods import good as good_bp
from .view.order import order as order_bp

# 创建一个主蓝图（而不是 Flask 应用）
admin_bp = Blueprint('admin', __name__, static_folder='../static')

# 注册子蓝图（user、goods、order）
admin_bp.register_blueprint(user_bp, url_prefix='/user')
admin_bp.register_blueprint(good_bp, url_prefix='/good')
admin_bp.register_blueprint(order_bp, url_prefix='/order')

def create_app_admin():
    return admin_bp  # ✅ 返回蓝图，而不是 Flask 应用